<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "t_base_class".
 *
 * @property string $id
 * @property string $class_id 原始班级ID
 * @property string $school_id 所属学校/机构
 * @property string $department_id 所属院系ID
 * @property string $major_id 所属专业ID
 * @property string $class_name 班级名称
 * @property string $class_no 编码
 * @property string $grade 年级
 * @property string $semester 学期
 * @property string $status 状态
 * @property string $begin_time 开始时间
 * @property string $end_time 结束时间
 * @property string $create_by 创建人
 * @property string $create_time 创建时间
 * @property string $update_by 更新人
 * @property string $update_time 更新时间
 * @property int $del_flag 删除标志
 * @property string $project_id 项目ID
 * @property string $old_id 对应3.0的classId
 */
class TBaseClass extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 't_base_class';
    }
    const MO_REN_ClASS = '-1';

    public static $defalutClass=[
         self::MO_REN_ClASS => '默认班级'
    ];

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id'], 'required'],
            [['begin_time', 'end_time', 'create_time', 'update_time'], 'safe'],
            [['del_flag'], 'integer'],
            [['id', 'class_id', 'school_id', 'department_id', 'major_id', 'create_by', 'update_by', 'project_id', 'old_id'], 'string', 'max' => 36],
            [['class_name'], 'string', 'max' => 128],
            [['class_no'], 'string', 'max' => 32],
            [['grade', 'semester', 'status'], 'string', 'max' => 64],
            [['id'], 'unique'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'class_id' => 'Class ID',
            'school_id' => 'School ID',
            'department_id' => 'Department ID',
            'major_id' => 'Major ID',
            'class_name' => 'Class Name',
            'class_no' => 'Class No',
            'grade' => 'Grade',
            'semester' => 'Semester',
            'status' => 'Status',
            'begin_time' => 'Begin Time',
            'end_time' => 'End Time',
            'create_by' => 'Create By',
            'create_time' => 'Create Time',
            'update_by' => 'Update By',
            'update_time' => 'Update Time',
            'del_flag' => 'Del Flag',
            'project_id' => 'Project ID',
            'old_id' => 'Old ID',
        ];
    }
}
